{template header}
<form class="form-horizontal" action="index.php?c=admin&a=setAppPackage" method="post" id="form1">
    <div class="control-group">
        <label class="control-label" for="inputShortDesc">更新渠道：</label>
        <div class="controls">
           <input type="radio" value="1" name="channelType" {if ($info['channel_type'] == 1) || !$info } checked {/if}  />&nbsp;全渠道
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="radio" value="5" name="channelType" {if $info['channel_type'] == 5} checked {/if} />&nbsp;部分渠道&nbsp;
            <input type="text" name="channelCode" placeholder="多个渠道号用逗号隔开" value="{if $info['channel_type'] == 5}{$info['channel_code']}{/if}"   />
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="inputShortDesc">强制更新：</label>
        <div class="controls">
            <input type="radio" value="0" name="isForce" {if $info['is_force_update'] == 0 } checked {/if}  />&nbsp;否&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="radio" value="5" name="isForce"  {if $info['is_force_update'] == 5} checked {/if} />&nbsp;是&nbsp;
            <select name="forceVersion" id="type">
                <option value="">请选择</option>
                {loop $arrVersion $k $v}
                <option value="{$v['version_num']}"  {if $info['force_update_version'] == $v['version_num']}selected = "selected";{/if} >{$v['version_num']}</option>
                {/loop}
            </select>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="inputShortDesc">更新文案：</label>
        <div class="controls">
           <textarea cols="30" rows="10" name="updateTxt">{$info['update_txt']}</textarea>
        </div>
    </div>
    <div class="control-group">
        <div class="controls">
            <input type="hidden" name="id" value="{$id}"/>
            <button type="button" class="btn" id="btn">提交</button>
        </div>
    </div>
</form>
{template footer}

<script type="text/javascript">
    $('#btn').click(function(){
        $.ajax({
            type:'POST',
            url:$('#form1').attr('action'),
            data:$('#form1').serialize(),
            dataType:'json',
            success:function(d){
                if(d.status=='ok'){
                    alert(d.error_msg);
                    window.location.href= d.url;
                }else{
                    alert(d.error_msg);
                }
            }
        })
    })

</script>